<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
<!-- 标题 -->
<div class="page-heade">
    <h2 class="title_color text-center">所有合同管理</h2>
</div>
<!-- 标题 -->
<div class="form-inline">
    <form action="">
        <table class="row-margin-top tab-content table-bordered table" border="1">
            <tr>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="" class="form-label">合同编号：</label>
                </td>
                <td><input type="text" class="form-control" name="sn" value="{$sn}"></td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="">合同主题：</label></td>
                <td><input type="text" class="form-control" name="htzt" value="{$htzt}"></td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="">合同类型：</label></td>
                <td>
                    <select name="htlx" id="" class="form-control">
                        <option value="">请选择</option>
                        {volist name="htlx" id="row"}
                        <option value="{$row.id}" {if $htlx==$row.id}selected{/if}>{$row.title}</option>
                        {/volist}
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="" class="form-label">合同金额：</label>
                </td>
                <td><input type="text" class="form-control" name="htje_min" value="{$htje_min}">-<input type="text" class="form-control" name="hxtj_max" value="{$htje_max}">元
                </td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="" class="form-label">我方名称：</label>
                </td>
                <td><input type="text" class="form-control" name="htqsf_wfmc" value="{$htqsf_wfmc}"></td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="" class="form-label">对方名称：</label>
                </td>
                <td><input type="text" class="form-control" name="htqsf_dfmc" value="{$htqsf_dfmc}"></td>
            </tr>
            <tr>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="" class="form-label">合同签署日期：</label>
                </td>
                <td>
                    <div class="form-group">
                        <input type="text" id="start" class="form-control layer-date "
                               style="display: inline-block;" name="htqsrq_min" value="{$htqsrq_min}">
                    </div>
                    <div class="form-group">
                        至
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control layer-date" style="display: inline-block;"
                               id="end" name="htqsrq_max" value="{$htqsrq_max}">
                    </div>
                </td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="">合同进度：</label></td>
                <td>
                    <select name="htjd" id="" class="form-control">
                        <option value="">请选择</option>
                        <option value="1" {if $htjd==1}selected{/if}>已签订</option>
                        <option value="2" {if $htjd==2}selected{/if}>未签订</option>
                    </select>
                </td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="">付款进度：</label></td>
                <td>
                    <select name="fkjd" id="" class="form-control">
                        <option value="">请选择</option>
                        <option value="1" {if $fkjd==1}selected{/if}>未付款</option>
                        <option value="2" {if $fkjd==2}selected{/if}>部分付款</option>
                        <option value="3" {if $fkjd==3}selected{/if}>已付清</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for=""
                                                                                    class="form-label">申请人：</label></td>
                <td><input type="text" class="form-control" name="sqr" value="{$sqr}"></td>
                <td class="text-right" style="min-width: 160px;width: 160px"><label for="">合同状态：</label></td>
                <td>
                    <select name="status" id="" class="form-control">
                        <option value="0">请选择</option>
                        <option value="1">已打回</option>
                        <option value="2">区域领导审批</option>
                        <option value="3">拆分人审批</option>
                        <option value="4">集团领导审批</option>
                        <option value="5">已归档</option>
                        <option value="6">已作废</option>
                        <option value="7">抄送</option>
                        <option value="8">已否决</option>
                    </select>
                </td>
                <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
                <td colspan="6" class="text-center">
                    <button class="btn btn-info query">查询</button>
                    <button class="btn btn-info emptyIf" type="button">清空查询条件</button>
                </td>
            </tr>
        </table>

        <table class="table table-striped row-margin-top table-bordered table-hover text-center bud_hei">
            <tr class="info text-center">
                <th class="text-center">NO.</th>
                <th class="text-center">合同编号</th>
                <th class="text-center">合同主题</th>
                <th class="text-center">合同类型</th>
                <th class="text-center">合同金额</th>
                <th class="text-center">我方名称</th>
                <th class="text-center">对方名称</th>
                <th class="text-center">合同状态</th>
                <th class="text-center">合同进度</th>
                <th class="text-center">付款进度</th>
                <th class="text-center">申请人</th>
                <th class="text-center">合同签署日期</th>
                <th class="text-center">操作</th>
            </tr>
            {volist name="data" id="row" key="k"}
            <tr>
                <td>{$k}</td>
                <td><a href="{:url('glht',['id'=>$row.id])}">{$row.sn}</a></td>
                <td>{$row.htzt}<span class="glyphicon glyphicon-ok duigou" title="已签订" aria-hidden="true"></span></td>
                <td>{$row.htlx_name}</td>
                <td>{$row.htje}</td>
                <td>{$row.htqsf_wfmc}</td>
                <td>{$row.htqsf_dfmc}</td>
                <td>{$row.status}</td>
                <td>{if $row.htjd==1}已签订{elseif $row.htjd==2}未签订{/if}</td>
                <td>{if $row.fkjd==1}未付款{elseif $row.fkjd==2}部分付款{elseif $row.fkjd==3}已付清{/if}</td>
                <td>{$row.sqr_name}</td>
                <td>{$row.htqdrq}</td>
                <td>
                    {if !$row.fkr}
                    <a href="{:url('glht',['id'=>$row.id])}" style="margin-right: 5px">管理</a>
                    {/if}
                    <a href="javascript:;">查看流程图</a>
                </td>
            </tr>
            {/volist}
        </table>
    </form>
     <div class="row text-center" id="pageText" style="padding: 0;margin: 0;">
			<div class="col-sm-6 text-left"><div class="padding-10 countSize">共{$count}条记录，{$maxpage}页&nbsp;&nbsp;</div></div>
			<div class="col-sm-6 text-right">{$page}</div>
		</div>
</div>
<!-- 全局js -->
{include file="Public/footer"}
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!--统计代码，可删除-->
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script>
    //清除查询条件
    $('.emptyIf').on('click',function () {
        var form = $(this).closest('form')
        form.find('input[type=text]').val('')
        form.find('select').val('')
        form.submit()
    })

    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY/MM/DD',
        min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY/MM/DD',
        min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    /*表单只能输出数字*/
    var numReg = document.getElementsByClassName('numReg');
    console.log(numReg)
    for (var i = 0; i < numReg.length; i++) {
        numReg[i].onkeyup = function () {
            this.value = this.value.replace(/[^\d]/g, '');
        }
    }
</script>
</body>

</html>
